package com.example.factory;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public abstract class DefaultFactory implements NodeFactory, InitializingBean, DisposableBean {

    @Override
    public void afterPropertiesSet() throws Exception {
        this.getNode().init();
        this.getNode().start();
    }

    @Override
    public void destroy() throws Exception {
        this.getNode().stop();
    }
}
